﻿@{
    ViewBag.Title = "保存会员类型接点奖励配置";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var list = (List<UserTypeJdRateConfigModel>)ViewData["list"];
}
@using JStore.Web.Controllers.UserTypeJdRateConfigs.ViewModels
@model SaveUserTypeJdRateConfigModel
<link href="../../Scripts/jquery-validation-engine/css/template.css" rel="stylesheet"
    type="text/css" />
<link href="../../Scripts/jquery-validation-engine/css/validationEngine.jquery.css"
    rel="stylesheet" type="text/css" />
<script src="../../Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-validation-engine/js/jquery.validationEngine.js"
    type="text/javascript"></script>
<script src="../../Scripts/jquery-validation-engine/js/languages/jquery.validationEngine-zh_CN.js"
    type="text/javascript"></script>
<script src="../../Scripts/AdminCommon.js" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $("#form1").validationEngine();
    })
</script>
<div class="right_box_card">
    <ul>
        <li class="right_box_card1"><a href="#">接点奖励配置</a></li>
    </ul>
</div>
<table class="right_box_tab" style="margin-top: 10px;" width="100%" border="0" cellspacing="0"
    cellpadding="0">
    <tr height="30" class="tab_title">
        <td>
            接点层索引
        </td>
        <td>
            提成比例
        </td>
        <td>
            区代提成比例
        </td>
        <td>
        </td>
    </tr>
    @foreach (var item in list)
    {
        <tr height="35" class="tab_td1" style="line-height: 26px;" onmouseover="this.className = 'tab_td2' "
            onmouseout=" this.className = 'tab_td1'">
            <td>
                @item.LayerIndex
            </td>
            <td>
                @item.Rate.ToString("p")
            </td>
            <td>
                @item.AreaRate.ToString("p")
            </td>
            <td>
                <a href="javascript:void(0);" onclick="DeletePost('@Url.Action("Delete", "UserTypeJdRateConfigs")',{id:@item.Id});">
                    删除</a>
            </td>
        </tr>
    }
</table>
@using (Html.BeginForm("Save", "UserTypeJdRateConfigs", FormMethod.Post, new { @class = "formular", id = "form1" }))
{
    @Html.HiddenFor(c => c.UserTypeId)
    <fieldset>
        <label>
            <span>@Html.LabelFor(c => c.LayerIndex)</span>
            @Html.TextBoxFor(c => c.LayerIndex, new { @class = "validate[required,min[1]] text-input" })
        </label>
        <label>
            <span>@Html.LabelFor(c => c.Rate)</span>
            @Html.TextBoxFor(c => c.Rate, new { @class = "validate[required,min[0.01],max[0.99]] text-input" })
        </label>
        <label>
            <span>@Html.LabelFor(c => c.AreaRate)</span>
            @Html.TextBoxFor(c => c.AreaRate, new { @class = "validate[required,min[0.01],max[0.99]] text-input" })
        </label> 
        <input type="submit" value="保存" class="submit" />
    </fieldset> 
}
